Optimal. Leaf size=53 \[ \frac{1}{4} \log \left (x^4+1\right )+\frac{1}{2} \tan ^{-1}\left (x^2\right )-\frac{\tan ^{-1}\left (1-\sqrt{2} x\right )}{\sqrt{2}}+\frac{\tan ^{-1}\left (\sqrt{2} x+1\right )}{\sqrt{2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0418564, antiderivative size = 53, normalized size of antiderivative = 1., number of steps used = 11, number of rules used = 8, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.471, Rules used = {1876, 1162, 617, 204, 1248, 635, 203, 260} \[ \frac{1}{4} \log \left (x^4+1\right )+\frac{1}{2} \tan ^{-1}\left (x^2\right )-\frac{\tan ^{-1}\left (1-\sqrt{2} x\right )}{\sqrt{2}}+\frac{\tan ^{-1}\left (\sqrt{2} x+1\right )}{\sqrt{2}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1876
Rule 1162
Rule 617
Rule 204
Rule 1248
Rule 635
Rule 203
Rule 260
Rubi steps
\begin{align*} \int \frac{1+x+x^2+x^3}{1+x^4} \, dx &=\int \left (\frac{1+x^2}{1+x^4}+\frac{x \left (1+x^2\right )}{1+x^4}\right ) \, dx\\ &=\int \frac{1+x^2}{1+x^4} \, dx+\int \frac{x \left (1+x^2\right )}{1+x^4} \, dx\\ &=\frac{1}{2} \int \frac{1}{1-\sqrt{2} x+x^2} \, dx+\frac{1}{2} \int \frac{1}{1+\sqrt{2} x+x^2} \, dx+\frac{1}{2} \operatorname{Subst}\left (\int \frac{1+x}{1+x^2} \, dx,x,x^2\right )\\ &=\frac{1}{2} \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,x^2\right )+\frac{1}{2} \operatorname{Subst}\left (\int \frac{x}{1+x^2} \, dx,x,x^2\right )+\frac{\operatorname{Subst}\left (\int \frac{1}{-1-x^2} \, dx,x,1-\sqrt{2} x\right )}{\sqrt{2}}-\frac{\operatorname{Subst}\left (\int \frac{1}{-1-x^2} \, dx,x,1+\sqrt{2} x\right )}{\sqrt{2}}\\ &=\frac{1}{2} \tan ^{-1}\left (x^2\right )-\frac{\tan ^{-1}\left (1-\sqrt{2} x\right )}{\sqrt{2}}+\frac{\tan ^{-1}\left (1+\sqrt{2} x\right )}{\sqrt{2}}+\frac{1}{4} \log \left (1+x^4\right )\\ \end{align*}
Mathematica [A] time = 0.0351092, size = 50, normalized size = 0.94 \[ \frac{1}{4} \left (\log \left (x^4+1\right )-2 \left (1+\sqrt{2}\right ) \tan ^{-1}\left (1-\sqrt{2} x\right )+2 \left (\sqrt{2}-1\right ) \tan ^{-1}\left (\sqrt{2} x+1\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.003, size = 102, normalized size = 1.9 \begin{align*}{\frac{\arctan \left ( -1+x\sqrt{2} \right ) \sqrt{2}}{2}}+{\frac{\sqrt{2}}{8}\ln \left ({\frac{1+{x}^{2}+x\sqrt{2}}{1+{x}^{2}-x\sqrt{2}}} \right ) }+{\frac{\arctan \left ( 1+x\sqrt{2} \right ) \sqrt{2}}{2}}+{\frac{\arctan \left ({x}^{2} \right ) }{2}}+{\frac{\sqrt{2}}{8}\ln \left ({\frac{1+{x}^{2}-x\sqrt{2}}{1+{x}^{2}+x\sqrt{2}}} \right ) }+{\frac{\ln \left ({x}^{4}+1 \right ) }{4}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.43715, size = 103, normalized size = 1.94 \begin{align*} -\frac{1}{4} \, \sqrt{2}{\left (\sqrt{2} - 2\right )} \arctan \left (\frac{1}{2} \, \sqrt{2}{\left (2 \, x + \sqrt{2}\right )}\right ) + \frac{1}{4} \, \sqrt{2}{\left (\sqrt{2} + 2\right )} \arctan \left (\frac{1}{2} \, \sqrt{2}{\left (2 \, x - \sqrt{2}\right )}\right ) + \frac{1}{4} \, \log \left (x^{2} + \sqrt{2} x + 1\right ) + \frac{1}{4} \, \log \left (x^{2} - \sqrt{2} x + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.56056, size = 440, normalized size = 8.3 \begin{align*} -\sqrt{-2 \, \sqrt{2} + 3} \arctan \left (\sqrt{x^{2} + \sqrt{2} x + 1}{\left (\sqrt{2} + 2\right )} \sqrt{-2 \, \sqrt{2} + 3} -{\left (\sqrt{2}{\left (x + 1\right )} + 2 \, x + 1\right )} \sqrt{-2 \, \sqrt{2} + 3}\right ) + \sqrt{2 \, \sqrt{2} + 3} \arctan \left (-{\left (\sqrt{2}{\left (x + 1\right )} - \sqrt{x^{2} - \sqrt{2} x + 1}{\left (\sqrt{2} - 2\right )} - 2 \, x - 1\right )} \sqrt{2 \, \sqrt{2} + 3}\right ) + \frac{1}{4} \, \log \left (x^{2} + \sqrt{2} x + 1\right ) + \frac{1}{4} \, \log \left (x^{2} - \sqrt{2} x + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.324015, size = 73, normalized size = 1.38 \begin{align*} \frac{\log{\left (x^{2} - \sqrt{2} x + 1 \right )}}{4} + \frac{\log{\left (x^{2} + \sqrt{2} x + 1 \right )}}{4} + 2 \left (\frac{1}{4} + \frac{\sqrt{2}}{4}\right ) \operatorname{atan}{\left (\sqrt{2} x - 1 \right )} + 2 \left (- \frac{1}{4} + \frac{\sqrt{2}}{4}\right ) \operatorname{atan}{\left (\sqrt{2} x + 1 \right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.06195, size = 95, normalized size = 1.79 \begin{align*} \frac{1}{2} \,{\left (\sqrt{2} - 1\right )} \arctan \left (\frac{1}{2} \, \sqrt{2}{\left (2 \, x + \sqrt{2}\right )}\right ) + \frac{1}{2} \,{\left (\sqrt{2} + 1\right )} \arctan \left (\frac{1}{2} \, \sqrt{2}{\left (2 \, x - \sqrt{2}\right )}\right ) + \frac{1}{4} \, \log \left (x^{2} + \sqrt{2} x + 1\right ) + \frac{1}{4} \, \log \left (x^{2} - \sqrt{2} x + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]